package highscore;

import configuration.Configuration;
import java.io.IOException; 

public class HighScoreDatabaseFactory {
	
	public HighScoreDatabase newDatabase() throws IOException{
		Configuration config = Configuration.getInstance(); 
		if(config.getHighScoreDatabaseType() == Configuration.FILE){
			FileHighScoreDatabase fileData = new FileHighScoreDatabase(); 
			return fileData; 
		} 
		if(config.getHighScoreDatabaseType() == Configuration.WEB){
			WebHighScoreDatabaseAdapter webBase = new WebHighScoreDatabaseAdapter(); 
			return webBase; 
		} 
		return null; 
	}
}
